package com.model.dao;

// Generated Nov 27, 2013 4:26:26 PM by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Level2Table generated by hbm2java
 */
@Entity
@Table(name = "level2_table", catalog = "shoppingcart_schema")
public class Level2Table implements java.io.Serializable {

	private Integer l2Id;
	private Level1Table level1Table;
	private String l2Name;
	private Set<Level3Table> level3Tables = new HashSet<Level3Table>(0);

	public Level2Table() {
	}

	public Level2Table(Level1Table level1Table, String l2Name,
			Set<Level3Table> level3Tables) {
		this.level1Table = level1Table;
		this.l2Name = l2Name;
		this.level3Tables = level3Tables;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "l2_id", unique = true, nullable = false)
	public Integer getL2Id() {
		return this.l2Id;
	}

	public void setL2Id(Integer l2Id) {
		this.l2Id = l2Id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "l1_id")
	public Level1Table getLevel1Table() {
		return this.level1Table;
	}

	public void setLevel1Table(Level1Table level1Table) {
		this.level1Table = level1Table;
	}

	@Column(name = "l2_name", length = 45)
	public String getL2Name() {
		return this.l2Name;
	}

	public void setL2Name(String l2Name) {
		this.l2Name = l2Name;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "level2Table")
	public Set<Level3Table> getLevel3Tables() {
		return this.level3Tables;
	}

	public void setLevel3Tables(Set<Level3Table> level3Tables) {
		this.level3Tables = level3Tables;
	}

}
